class Solution(object):
    def numberOfDays(self, year, month):
        """
        :type year: int
        :type month: int
        :rtype: int
        """
        if month in {1, 3, 5, 7, 8, 10, 12}:
            return 31
        if month in {4, 6, 9, 11}:
            return 30
        if month == 2:
            if year % 4 != 0:
                return 28
            else:
                if year % 100 != 0:
                    return 29
                else:
                    if year % 400 == 0:
                        return 29
                    else:
                        return 28


data = Solution()
year = 2102
month = 2
print(data.numberOfDays(year, month))
